package task4;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-06-14
 * Time:14:42
 */
public class FoodPackage {
    private String brand;
    private Vegetable vegetable;
    private Grain grain;

    public FoodPackage(String brand, Vegetable vegetable, Grain grain) {
        this.brand = brand;
        this.vegetable = vegetable;
        this.grain = grain;
    }
    public void showMessage(){
        System.out.println("食材礼包品牌："+this.brand+"；成本价格："+(this.grain.getPrice()+this.vegetable.getPrice()));
        System.out.println("蔬菜名称："+this.vegetable.getName()+"；价格："+this.vegetable.getPrice());
        System.out.println("粮食名称："+this.grain.getName()+"；价格："+this.grain.getPrice());
    }
}
